package com.sat.ndk;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {



    private JNI jni;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        jni = new JNI(this);
    }



    public void click(View view) {
        Toast.makeText(this, "result="+jni.Add(11,64), Toast.LENGTH_SHORT).show();
    }

    public void click1(View view) {
        Toast.makeText(this, jni.ChangeStr("abcde"), Toast.LENGTH_SHORT).show();
    }

    public void click2(View view) {
        int[] array = new int[]{1,3,5,7,9};
        jni.arrIncrease(array);
        for (int i :
                array) {
            Log.d("TAG", i + "===");
        }
    }

    //C回调空参方法
    public void click3(View view) {
        jni.callbackVoid();
    }
    //C回调int参方法
    public void click4(View view) {
        jni.callbackVoidInt();
    }
    //C回调string参方法
    public void click5(View view) {
        jni.callbackVoidString();
    }

    public void click6(View view) {
        jni.callbackVoidToast();
    }


}
